﻿
namespace System.Management.HyperV.Model.Msvm.CIM
{
    /// <summary>
    /// Abstracts the concept of an element that is enabled and disabled, such as a logical device or a service access point.
    /// </summary>
    /// <remarks>http://msdn.microsoft.com/en-us/library/cc136818(VS.85).aspx</remarks>
    public abstract class EnabledLogicalElement : LogicalElement
    {
        #region Constructor
        internal protected EnabledLogicalElement(ManagementObject wmiInstance)
            : base(wmiInstance)
        {
        }
        #endregion

        public ushort EnabledDefault
        {
            get { return (ushort)_dmo.EnabledDefault; }
        }
        public ushort EnabledState
        {
            get { return (ushort)_dmo.EnabledState; }
        }
        public string OtherEnabledState 
        {
            get { return _dmo.OtherEnabledState as string; }
        }
        public ushort RequestedState
        {
            get { return (ushort)_dmo.RequestedState; }
        }
        public string TimeOfLastStateChange
        {
            get { return _dmo.TimeOfLastStateChange as string; }
        }

        /// <summary>
        /// Requests that the state of the element be changed to the value specified in the RequestedState parameter. When the requested state change takes place, the EnabledState and RequestedState of the element will be the same. Invoking the RequestStateChange method multiple times could result in earlier requests being overwritten or lost. If 0 is returned, then the task completed successfully and the use of ConcreteJob was not required. If 4096 (0x1000) is returned, then the task will take some time to complete, ConcreteJob will be created, and its reference returned in the output parameter Job. Any other return code indicates an error condition.
        /// </summary>
        /// <remarks>http://msdn.microsoft.com/en-us/library/cc137002(VS.85).aspx</remarks>
        internal Job RequestStateChange(ushort requestedState, object timeout)
        {
            throw new NotImplementedException();
        }
    }
}
